import { request } from '@vipl520/utils'

const path = '/gs_gold/admin.config/'

export function getValue(key) {
  return request({
    url: path + 'getValue',
    method: 'post',
    data: {
      key
    }
  })
}

export function setValue(key, value) {
  return request(
    {
      url: path + 'setValue',
      method: 'post',
      data: {
        key,
        value
      }
    },
    {
      code_success_show: true
    }
  )
}

export function setValueById(id, value) {
  return request(
    {
      url: path + 'setValueById',
      method: 'post',
      data: { id, value }
    },
    {
      code_success_show: true
    }
  )
}

export function getFormByKey(key) {
  return request(
    {
      url: path + 'getFormByKey',
      method: 'post',
      data: { key }
    },
    {
      code_success_show: true
    }
  )
}

export function getJoke(fileName) {
  return request(
    {
      url: '/gs_gold/app.config/getJoke',
      method: 'post',
      data: { fileName }
    },
    {
      code_error_show: true
    }
  )
}
